/*
 * jxDao Project (2014)
 * 
 * by Denilson Edinaldo Pinto
 * 
 * LGPL
 * Copyright (C) 2014
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY;} without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package org.jxDao.dao.filter;

import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Collection;

/**
 * @author Denilson Edinaldo Pinto
 * @porject jxDao
 * @package org.jxDao.dao.filter
 * @date 24/10/2014 - 19:37:59
 */
public final class FilterUtil {
	
	/**
	 * @param columnName
	 * @param start
	 * @param end
	 * @return {@link BetweenFilter}
	 */
	public static BetweenFilter between(final String columnName, final Date start, final Date end) {
	
		return new BetweenFilter(columnName, start, end);
	}
	
	/**
	 * @param columnName
	 * @param start
	 * @param end
	 * @return {@link BetweenFilter}
	 */
	public static BetweenFilter between(final String columnName, final Number start, final Number end) {
	
		return new BetweenFilter(columnName, start, end);
	}
	
	/**
	 * @param columnName
	 * @param start
	 * @param end
	 * @return {@link BetweenFilter}
	 */
	public static BetweenFilter between(final String columnName, final Object start, final Object end) {
	
		return new BetweenFilter(columnName, start, end);
	}
	
	/**
	 * @param columnName
	 * @param start
	 * @param end
	 * @return {@link BetweenFilter}
	 */
	public static BetweenFilter between(final String columnName, final Time start, final Time end) {
	
		return new BetweenFilter(columnName, start, end);
	}
	
	/**
	 * @param columnName
	 * @param start
	 * @param end
	 * @return {@link BetweenFilter}
	 */
	public static BetweenFilter between(final String columnName, final Timestamp start, final Timestamp end) {
	
		return new BetweenFilter(columnName, start, end);
	}
	
	/**
	 * @param sql
	 * @return {@link CustomFilter}
	 */
	public static CustomFilter custom(final String sql) {
	
		return new CustomFilter(sql);
	}
	
	/**
	 * @param sql
	 * @param groupBy
	 * @return {@link CustomFilter}
	 */
	public static CustomFilter custom(final String sql, final GroupBy groupBy) {
	
		return new CustomFilter(sql, groupBy);
	}
	
	/**
	 * @param sql
	 * @param groupBy
	 * @param orderBy
	 * @return {@link CustomFilter}
	 */
	public static CustomFilter custom(final String sql, final GroupBy groupBy, final OrderBy orderBy) {
	
		return new CustomFilter(sql, groupBy, orderBy);
	}
	
	/**
	 * @param sql
	 * @param orderBy
	 * @return {@link CustomFilter}
	 */
	public static CustomFilter custom(final String sql, final OrderBy orderBy) {
	
		return new CustomFilter(sql, orderBy);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link EqualFilter}
	 */
	public static EqualFilter equal(final String columnName, final Object value) {
	
		return new EqualFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @param isMD5Value
	 * @return {@link EqualFilter}
	 */
	public static EqualFilter equal(final String columnName, final Object value, final boolean isMD5Value) {
	
		return new EqualFilter(columnName, value, isMD5Value);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link GreaterOrEqualFilter}
	 */
	public static GreaterOrEqualFilter greaterOrEqual(final String columnName, final Date value) {
	
		return new GreaterOrEqualFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link GreaterOrEqualFilter}
	 */
	public static GreaterOrEqualFilter greaterOrEqual(final String columnName, final Number value) {
	
		return new GreaterOrEqualFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link GreaterOrEqualFilter}
	 */
	public static GreaterOrEqualFilter greaterOrEqual(final String columnName, final Object value) {
	
		return new GreaterOrEqualFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link GreaterOrEqualFilter}
	 */
	public static GreaterOrEqualFilter greaterOrEqual(final String columnName, final Time value) {
	
		return new GreaterOrEqualFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link GreaterOrEqualFilter}
	 */
	public static GreaterOrEqualFilter greaterOrEqual(final String columnName, final Timestamp value) {
	
		return new GreaterOrEqualFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link GreaterThanFilter}
	 */
	public static GreaterThanFilter greaterThan(final String columnName, final Date value) {
	
		return new GreaterThanFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link GreaterThanFilter}
	 */
	public static GreaterThanFilter greaterThan(final String columnName, final Number value) {
	
		return new GreaterThanFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link GreaterThanFilter}
	 */
	public static GreaterThanFilter greaterThan(final String columnName, final Object value) {
	
		return new GreaterThanFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link GreaterThanFilter}
	 */
	public static GreaterThanFilter greaterThan(final String columnName, final Time value) {
	
		return new GreaterThanFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link GreaterThanFilter}
	 */
	public static GreaterThanFilter greaterThan(final String columnName, final Timestamp value) {
	
		return new GreaterThanFilter(columnName, value);
	}
	
	/**
	 * @param groupBy
	 * @return {@link CustomFilter}
	 */
	public static CustomFilter groupBy(final GroupBy groupBy) {
	
		return new CustomFilter(groupBy);
	}
	
	/**
	 * @param groupBy
	 * @param orderBy
	 * @return {@link CustomFilter}
	 */
	public static CustomFilter groupByOrderBy(final GroupBy groupBy, final OrderBy orderBy) {
	
		return new CustomFilter(groupBy, orderBy);
	}
	
	/**
	 * property LIKE UPPER('%value%')
	 * 
	 * @param columnName
	 * @param value
	 * @return {@link ILikeBetweenFilter}
	 */
	public static ILikeBetweenFilter iLikeBetween(final String columnName, final String value) {
	
		return new ILikeBetweenFilter(columnName, value);
	}
	
	/**
	 * property LIKE UPPER('%value')
	 * 
	 * @param columnName
	 * @param value
	 * @return {@link ILikeEndFilter}
	 */
	public static ILikeEndFilter iLikeEnd(final String columnName, final String value) {
	
		return new ILikeEndFilter(columnName, value);
	}
	
	/**
	 * property LIKE UPPER('value')
	 * 
	 * @param columnName
	 * @param value
	 * @return {@link ILikeEqualFilter}
	 */
	public static ILikeEqualFilter iLikeEqual(final String columnName, final String value) {
	
		return new ILikeEqualFilter(columnName, value);
	}
	
	/**
	 * property LIKE UPPER('value%')
	 * 
	 * @param columnName
	 * @param value
	 * @return {@link ILikeStartFilter}
	 */
	public static ILikeStartFilter iLikeStart(final String columnName, final String value) {
	
		return new ILikeStartFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param values
	 * @return {@link InFilter}
	 */
	public static InFilter in(final String columnName, final Collection<?> values) {
	
		return new InFilter(columnName, values);
	}
	
	/**
	 * @param columnName
	 * @param values
	 * @return {@link InFilter}
	 */
	public static InFilter in(final String columnName, final Object[] values) {
	
		return new InFilter(columnName, values);
	}
	
	/**
	 * @param columnName
	 * @return {@link IsNotNullFilter}
	 */
	public static IsNotNullFilter isNotNull(final String columnName) {
	
		return new IsNotNullFilter(columnName);
	}
	
	/**
	 * @param columnName
	 * @return {@link IsNullFilter}
	 */
	public static IsNullFilter isNull(final String columnName) {
	
		return new IsNullFilter(columnName);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link LessOrEqualFilter}
	 */
	public static LessOrEqualFilter lessOrEqual(final String columnName, final Date value) {
	
		return new LessOrEqualFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link LessOrEqualFilter}
	 */
	public static LessOrEqualFilter lessOrEqual(final String columnName, final Number value) {
	
		return new LessOrEqualFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link LessOrEqualFilter}
	 */
	public static LessOrEqualFilter lessOrEqual(final String columnName, final Object value) {
	
		return new LessOrEqualFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link LessOrEqualFilter}
	 */
	public static LessOrEqualFilter lessOrEqual(final String columnName, final Time value) {
	
		return new LessOrEqualFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link LessOrEqualFilter}
	 */
	public static LessOrEqualFilter lessOrEqual(final String columnName, final Timestamp value) {
	
		return new LessOrEqualFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link LessThanFilter}
	 */
	public static LessThanFilter lessThan(final String columnName, final Date value) {
	
		return new LessThanFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link LessThanFilter}
	 */
	public static LessThanFilter lessThan(final String columnName, final Number value) {
	
		return new LessThanFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link LessThanFilter}
	 */
	public static LessThanFilter lessThan(final String columnName, final Object value) {
	
		return new LessThanFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link LessThanFilter}
	 */
	public static LessThanFilter lessThan(final String columnName, final Time value) {
	
		return new LessThanFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link LessThanFilter}
	 */
	public static LessThanFilter lessThan(final String columnName, final Timestamp value) {
	
		return new LessThanFilter(columnName, value);
	}
	
	/**
	 * property LIKE '%value%'
	 * 
	 * @param columnName
	 * @param value
	 * @return {@link LikeBetweenFilter}
	 */
	public static LikeBetweenFilter likeBetween(final String columnName, final String value) {
	
		return new LikeBetweenFilter(columnName, value);
	}
	
	/**
	 * property LIKE '%value'
	 * 
	 * @param columnName
	 * @param value
	 * @return {@link LikeEndFilter}
	 */
	public static LikeEndFilter likeEnd(final String columnName, final String value) {
	
		return new LikeEndFilter(columnName, value);
	}
	
	/**
	 * property LIKE 'value'
	 * 
	 * @param columnName
	 * @param value
	 * @return {@link LikeEqualFilter}
	 */
	public static LikeEqualFilter likeEqual(final String columnName, final String value) {
	
		return new LikeEqualFilter(columnName, value);
	}
	
	/**
	 * property LIKE 'value%'
	 * 
	 * @param columnName
	 * @param value
	 * @return {@link LikeStartFilter}
	 */
	public static LikeStartFilter likeStart(final String columnName, final String value) {
	
		return new LikeStartFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param start
	 * @param end
	 * @return {@link NotBetweenFilter}
	 */
	public static NotBetweenFilter notBetween(final String columnName, final Date start, final Date end) {
	
		return new NotBetweenFilter(columnName, start, end);
	}
	
	/**
	 * @param columnName
	 * @param start
	 * @param end
	 * @return {@link NotBetweenFilter}
	 */
	public static NotBetweenFilter notBetween(final String columnName, final Number start, final Number end) {
	
		return new NotBetweenFilter(columnName, start, end);
	}
	
	/**
	 * @param columnName
	 * @param start
	 * @param end
	 * @return {@link NotBetweenFilter}
	 */
	public static NotBetweenFilter notBetween(final String columnName, final Object start, final Object end) {
	
		return new NotBetweenFilter(columnName, start, end);
	}
	
	/**
	 * @param columnName
	 * @param start
	 * @param end
	 * @return {@link NotBetweenFilter}
	 */
	public static NotBetweenFilter notBetween(final String columnName, final Time start, final Time end) {
	
		return new NotBetweenFilter(columnName, start, end);
	}
	
	/**
	 * @param columnName
	 * @param start
	 * @param end
	 * @return {@link NotBetweenFilter}
	 */
	public static NotBetweenFilter notBetween(final String columnName, final Timestamp start, final Timestamp end) {
	
		return new NotBetweenFilter(columnName, start, end);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link NotEqualFilter}
	 */
	public static NotEqualFilter notEqual(final String columnName, final Object value) {
	
		return new NotEqualFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @param isMD5Value
	 * @return {@link NotEqualFilter}
	 */
	public static NotEqualFilter notEqual(final String columnName, final Object value, final boolean isMD5Value) {
	
		return new NotEqualFilter(columnName, value, isMD5Value);
	}
	
	/**
	 * property NOT LIKE UPPER('%value%')
	 * 
	 * @param columnName
	 * @param value
	 * @return {@link NotILikeBetweenFilter}
	 */
	public static NotILikeBetweenFilter notILikeBetween(final String columnName, final String value) {
	
		return new NotILikeBetweenFilter(columnName, value);
	}
	
	/**
	 * property NOT LIKE UPPER('%value')
	 * 
	 * @param columnName
	 * @param value
	 * @return {@link NotILikeEndFilter}
	 */
	public static NotILikeEndFilter notILikeEnd(final String columnName, final String value) {
	
		return new NotILikeEndFilter(columnName, value);
	}
	
	/**
	 * property NOT LIKE UPPER('value')
	 * 
	 * @param columnName
	 * @param value
	 * @return {@link NotILikeEqualFilter}
	 */
	public static NotILikeEqualFilter notILikeEqual(final String columnName, final String value) {
	
		return new NotILikeEqualFilter(columnName, value);
	}
	
	/**
	 * property NOT LIKE UPPER('value%')
	 * 
	 * @param columnName
	 * @param value
	 * @return {@link NotILikeStartFilter}
	 */
	public static NotILikeStartFilter notILikeStart(final String columnName, final String value) {
	
		return new NotILikeStartFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param values
	 * @return {@link NotInFilter}
	 */
	public static NotInFilter notIn(final String columnName, final Collection<?> values) {
	
		return new NotInFilter(columnName, values);
	}
	
	/**
	 * @param columnName
	 * @param values
	 * @return {@link NotInFilter}
	 */
	public static NotInFilter notIn(final String columnName, final Object[] values) {
	
		return new NotInFilter(columnName, values);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link NotLikeBetweenFilter}
	 */
	public static NotLikeBetweenFilter notLikeBetween(final String columnName, final String value) {
	
		return new NotLikeBetweenFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link NotLikeEndFilter}
	 */
	public static NotLikeEndFilter notLikeEnd(final String columnName, final String value) {
	
		return new NotLikeEndFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link NotLikeEqualFilter}
	 */
	public static NotLikeEqualFilter notLikeEqual(final String columnName, final String value) {
	
		return new NotLikeEqualFilter(columnName, value);
	}
	
	/**
	 * @param columnName
	 * @param value
	 * @return {@link NotLikeStartFilter}
	 */
	public static NotLikeStartFilter notLikeStart(final String columnName, final String value) {
	
		return new NotLikeStartFilter(columnName, value);
	}
	
	/**
	 * @param orderBy
	 * @return {@link CustomFilter}
	 */
	public static CustomFilter orderBy(final OrderBy orderBy) {
	
		return new CustomFilter(orderBy);
	}
}
